/* 通用页面样式 - 供AI、UIUX、Search等页面使用 */

/* 全局字体样式和rem基准 */
html {
  font-size: 16px; /* 1rem = 16px */
  scroll-behavior: smooth;
}

/* 通用页面容器 - 真正全屏，抵消Layout的margin-top */
.page-container {
  min-height: 100vh;
  padding: 0;
  margin: -64px 0 0 0; /* 抵消Layout组件的margin-top: 64px */
  padding-top: 64px; /* 确保内容不被顶部导航遮挡 */
  background: var(--background-light);
  width: 100vw;
  overflow-x: hidden;
  position: relative !important;
  transform: none !important;
  -webkit-transform: none !important;
  will-change: auto !important;
  perspective: none !important;
  contain: none !important;
}

/* HeroBanner下方的Banner样式 */
.hero-bottom-banner {
  margin-top: -2rem; /* 稍微上移，与HeroBanner重叠一点 */
  z-index: 5;
  position: relative;
  padding: 0 2rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
}

/* 头部Hero区域 - 恢复背景图片 */
.hero-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.2) 100%), var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 3rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  height: 450px;
  display: flex;
  align-items: center;
  width: 100vw;
  margin: 0;
  box-sizing: border-box;
}

.hero-content {
  max-width: 50rem;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 2rem; /* 统一间距：2rem */
}

.hero-title {
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem; /* 统一使用1rem间距 */
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #666;
  margin-bottom: 1rem; /* 统一使用1rem间距 */
  line-height: 1.5;
  font-weight: 500;
}

.hero-subtitle mark {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
}

/* 简化搜索框样式 */
.hero-search {
  max-width: 37.5rem;
  margin: 0 auto 2rem;
}

.hero-search-input {
  height: 3rem;
  border-radius: 0.5rem;
  background: var(--white);
  border: 0.0625rem solid var(--border-color);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.875rem;
}

.hero-search-input:hover,
.hero-search-input:focus-within {
  border-color: var(--primary-color);
}

.hero-search-input input {
  font-size: 0.875rem;
  color: var(--text-primary);
  border: none;
  background: transparent;
  flex: 1;
  outline: none;
}

.hero-search-input input::placeholder {
  color: var(--text-light);
}

.hero-search-input .search-icon {
  margin-right: 0.5rem;
  color: var(--text-light);
}

.hero-search-input .search-button {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}

.hero-search-input .search-button:hover {
  background: var(--primary-dark);
}

/* 热门搜索标签 - 统一黑色字体样式 */
.hot-search-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.tag-label {
  color: #333;
  font-size: 0.875rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

.tag-item {
  color: #333;
  padding: 0.375rem 1rem;
  border-radius: 1.25rem;
  font-size: 0.8125rem;
  cursor: pointer;
  border: 0.0625rem solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.tag-item:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* 主要布局 - 简洁版本，不处理侧边栏 */
.main-layout {
  display: flex;
  gap: 1rem;
  margin: 1rem auto; /* 增加顶部间距并居中对齐 */
  align-items: flex-start;
  min-height: calc(100vh - 400px);
  width: 100%;
  box-sizing: border-box;
}

/* 右侧工具列表 - 简洁版本 */
.tools-main {
  flex: 1;
  min-width: 0;
}

.tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 0.125rem solid var(--border-color);
}

.tools-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tools-count {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* 热门推荐网址网格 - 统一固定网格布局 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* 自适应布局 */
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* 文章卡片网格保持与工具卡片网格样式一致 */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* 超大屏幕最多显示6列 */
@media (min-width: 1600px) {
  .tools-grid, .article-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 大屏幕显示4-5列 */
@media (min-width: 1200px) and (max-width: 1599px) {
  .tools-grid, .article-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 中等屏幕显示3列 */
@media (min-width: 901px) and (max-width: 1199px) {
  .tools-grid, .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 小屏幕显示2列 */
@media (min-width: 769px) and (max-width: 900px) {
  .tools-grid, .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tool-item-card {
  background: var(--white);
  border-radius: 0.5rem;
  padding: 0.875rem;
  border: 0.0625rem solid #e1e5e9;
  transition: border-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  /* 统一卡片大小 - 固定高度和宽度 */
  height: 120px;
  overflow: hidden;
  /* 确保卡片不会被内容撑大 */
  box-sizing: border-box;
}

.tool-item-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* 左侧图标区域 - 参考GitHub样式 */
.tool-item-icon {
  width: 2rem;
  height: 2rem;
  background: transparent;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.tool-item-icon img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  object-fit: cover;
}

.tool-item-icon-fallback {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--background-light);
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 右侧内容区域 - 参考GitHub卡片布局 */
.tool-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  /* 确保内容在固定高度内合理分布 */
  justify-content: space-between;
  height: 100%;
}

.tool-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0;
  flex-shrink: 0;
}

.tool-item-info {
  flex: 1;
  min-width: 0;
}

.tool-item-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
  text-decoration: none;
}

.tool-item-name:hover {
  text-decoration: underline;
}

.tool-item-description {
  font-size: 0.800rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 0.000rem 0;
  /* 确保描述文本在固定高度内显示 - 两行省略号 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  max-height: 2.8em; /* 约两行文本的高度 */
  /* 兼容性处理 */
  word-wrap: break-word;
  word-break: break-word;
}

.tool-item-badges {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
  align-self: flex-start;
}

/* 底部元数据区域 - 模仿GitHub样式 */
.tool-item-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-light);
  /* 固定在底部 */
  flex-shrink: 0;
  margin-top: auto;
}

.tool-item-tags {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  /* 限制标签显示数量，避免溢出 */
  max-height: 1.5rem;
  overflow: hidden;
}

/* 优化标签样式 - 更淡雅的颜色 */
.tool-tag {
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 0.0625rem solid color-mix(in srgb, var(--border-color) 40%, transparent 60%); /* 更淡的边框 */
  background: color-mix(in srgb, var(--background-light) 60%, transparent 40%); /* 更淡的背景 */
  color: var(--text-quaternary, #9ca3af); /* 更淡的文字颜色 */
  opacity: 0.8; /* 增加整体透明度 */
  transition: all 0.2s ease;
}

.tool-tag:hover {
  background: color-mix(in srgb, var(--primary-light) 60%, transparent 40%); /* 更淡的hover背景 */
  color: color-mix(in srgb, var(--primary-color) 80%, transparent 20%); /* 更淡的hover文字 */
  opacity: 1; /* hover时恢复不透明 */
}

.load-more-section {
  text-align: center;
  margin-top: 2.5rem;
}

/* ===== 内容区域样式 ===== */
.content-section {
  margin-bottom: 1rem;
  scroll-margin-top: 80px;
}

/* 统一分类头部样式 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  /* 不要添加border-bottom */
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

/* 查看更多按钮 */
.view-more-btn {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.view-more-btn:hover {
  color: var(--primary-color);
}

/* 移动端底部的查看更多按钮 */
.mobile-view-more {
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  display: none;
}

.mobile-view-more-btn {
  display: inline-block;
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  border: 0.0625rem solid var(--border-color);
  border-radius: 1rem;
  transition: all 0.2s ease;
}

.mobile-view-more-btn:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  
  .mobile-view-more {
    display: block;
  }
}

/* ===== 简洁分类标题样式 ===== */
.section-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
}

.section-header-simple h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

/* 程序员风格装饰 - 模仿代码注释 */
.section-header-simple h2::after {
  content: '// 精选优质工具';
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-light);
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  opacity: 0.6;
  margin-left: 0.5rem;
}

/* 为不同分类添加不同的注释 */
.section-header-simple h2[data-category="ui"]::after {
  content: '// UI设计精品';
}

.section-header-simple h2[data-category="inspiration"]::after {
  content: '// 创意灵感源泉';
}

.section-header-simple h2[data-category="tools"]::after {
  content: '// 设计效率工具';
}

.section-header-simple h2[data-category="material"]::after {
  content: '// 素材资源库';
}

.section-header-simple h2[data-category="font"]::after {
  content: '// 字体设计';
}

.section-header-simple h2[data-category="color"]::after {
  content: '// 配色方案';
}

.section-header-simple h2[data-category="image"]::after {
  content: '// 图像处理';
}

.section-header-simple h2[data-category="tutorial"]::after {
  content: '// 学习教程';
}

/* 添加小装饰线条 */
.section-header-simple h2::before {
  content: '';
  width: 0.25rem;
  height: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 0.125rem;
  flex-shrink: 0;
}

/* 响应式调整 - 移动端隐藏装饰注释 */
@media (max-width: 768px) {
  .section-header-simple h2::after {
    display: none;
  }
  
  .section-header-simple h2 {
    font-size: 1.125rem;
  }
}

.resource-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== 搜索结果样式 ===== */
.empty-result {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-secondary);
}

.empty-result p {
  font-size: 1rem;
  margin: 0;
}

/* ===== 平滑滚动优化 ===== */
html {
  scroll-behavior: smooth;
}

/* 锚点偏移调整 */
.content-section:target {
  scroll-margin-top: 464px;
}

/* 移动端优化 - 简洁布局 */
@media (max-width: 768px) {
  .tools-grid, .article-grid {
    grid-template-columns: repeat(2, 1fr); /* 移动端两列 */
    gap: 0.5rem;
  }

  .tool-item-card {
    padding: 0.75rem;
    /* 移动端固定高度 */
    height: 110px;
  }
}

/* 平板端优化 - 简洁版 */
@media (max-width: 1024px) and (min-width: 769px) {
  html {
    font-size: 15px;
  }
  
  .hero-content {
    padding: 0 1.5rem;
  }
  
  .tools-grid, .article-grid {
    grid-template-columns: repeat(3, 1fr); /* 平板端3列 */
  }
}

/* 加载状态 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
  min-height: 200px;
}

.loading-text {
  font-size: 16px;
  color: #666;
  opacity: 0.8;
} 